#pragma once

#include <QDebug>
#include "Command.h"
#include "KeyOperationsManager.h"
#include "EncryptionOperationsManager.h"

namespace kryptos { namespace controller {

///////////////////////////////////////////////////////
///////////// ENCRYPTION OPERATIONS ///////////////////
class EncryptCommand : public Command
{
  Q_OBJECT
  public:

    EncryptCommand(EncryptionOperationsManager& manager) : m_manager(manager){}

  public slots:
    void execute(QMap<QString, QString> params=QMap<QString, QString>())
    {
        qDebug() << "Encrypt executed";
        m_manager.encrypt(params);
    }

  private:
    EncryptionOperationsManager& m_manager;
};

class DecryptCommand : public Command
{
  Q_OBJECT
  public:

    DecryptCommand(EncryptionOperationsManager& manager) : m_manager(manager){}

  public slots:
    void execute(QMap<QString, QString> params=QMap<QString, QString>())
    {
        qDebug() << "Decrypt executed";
        m_manager.decrypt(params);
    }

  private:
    EncryptionOperationsManager& m_manager;

};
////////////////////////////////////////////////////
////////////// DELETE OPERATIONS ///////////////////
class DeleteCommand : public Command
{
  Q_OBJECT
  public:

    DeleteCommand(){}

  public slots:
    void execute(QMap<QString, QString> params=QMap<QString, QString>())
    {
        qDebug() << "Delete executed";
    }
};
////////////////////////////////////////////////////
/////////////// KEY OPERATIONS /////////////////////
class CreateKeyCommand : public Command
{
  Q_OBJECT
  public:

    CreateKeyCommand(KeyOperationsManager& manager) : m_manager(manager){}

  public slots:
    void execute(QMap<QString, QString> params=QMap<QString, QString>())
    {
        qDebug() << "Create Key executed";
        m_manager.createKey(params);
    }

  private:
    KeyOperationsManager& m_manager;
};

class ShareKeyCommand : public Command
{
  Q_OBJECT
  public:

    ShareKeyCommand(KeyOperationsManager& manager) : m_manager(manager){}

  public slots:
    void execute(QMap<QString, QString> params=QMap<QString, QString>())
    {
        qDebug() << "Share Key executed";
    }

  private:
    KeyOperationsManager& m_manager;

};

}}
